package com.wc.alorithm_luogu.P5740;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/4/24 13:46
 * @description https://www.luogu.com.cn/problem/P5740
 * 最厉害的学生
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        String name;
        int chineseScore;
        int mathScore;
        int englishScore;
        int totalScore;
        int maxTotalScore = -1;
        StringBuilder ans = null;
        while (N-- > 0) {
            name = sc.next();
            chineseScore = Integer.parseInt(sc.next());
            mathScore = Integer.parseInt(sc.next());
            englishScore = Integer.parseInt(sc.next());
            totalScore = chineseScore + mathScore + englishScore;
            if (totalScore > maxTotalScore) {
                maxTotalScore = totalScore;
                ans = new StringBuilder();
                ans.append(name);
                ans.append(" ").append(chineseScore);
                ans.append(" ").append(mathScore);
                ans.append(" ").append(englishScore);
            }
        }

        System.out.println(ans);
    }
}
